using ECommerce.Web.Models;

namespace ECommerce.Web.NHibernate.Mappings.EntityMappings
{
    public class CategoryMap : EntityMap<Category>
    {
         public CategoryMap()
         {
             Map(x => x.Name).Not.Nullable();
             Map(x => x.Description).Length(MaxLength);

             References(x => x.Parent);

             HasMany(x => x.Children);
         }
    }
}